#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int A(int n, int m)
{
    if (m == 1)
        return n;
    else
        return n * A(n - 1, m - 1);
}


int main() {
    int n = 0, m = 0;
    scanf("%d %d", &n, &m);
    printf("%d", A(n, m));
    return 0;
}